#pragma once
#include "stdafx.h"
#include <TwOgreWindowManager.h>
#include <TwOgreWindow.h>
#include "MouseCursor.h"

class GUI: public Ogre::Singleton<GUI>
{
public:
	GUI(Ogre::RenderWindow* renderWindow, Ogre::SceneManager* sceneManager);
	virtual ~GUI();

	void update();

	void injectKeyPressed(const OIS::KeyEvent& event)
	{
		windowManager->injectKeyPressed(event);
	}

	void injectKeyReleased(const OIS::KeyEvent& event)
	{
		windowManager->injectKeyReleased(event);
	}

	void injectMousePressed(const OIS::MouseEvent& event, OIS::MouseButtonID id)
	{
		windowManager->injectMousePressed(event, id);
	}

	void injectMouseReleased(const OIS::MouseEvent& event, OIS::MouseButtonID id)
	{
		windowManager->injectMouseReleased(event, id);
	}

	void injectMouseMoved(const OIS::MouseEvent& event)
	{
		windowManager->injectMouseMoved(event);
		//cursor->updatePosition(event.state.X.abs, event.state.Y.abs);
	}

	MouseCursor* getCursor() const { return cursor; }

protected:
	static void TW_CALL exit(void* clientData);

private:
	Ogre::SceneManager* sceneManager;
	Ogre::RenderWindow* renderWindow;
	TwOgre::Window* statWindow;
	TwOgre::WindowManager* windowManager;
	TwOgre::RealVariable* fps;
	TwOgre::ButtonVariable* exitButton;
	MouseCursor* cursor;
};